package com.peppa.petshop.controller;

import com.peppa.petshop.service.CustomerService;
import com.peppa.petshop.vo.DataVO;
import com.peppa.petshop.vo.IndentVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author SongTiantian
 * @create 2021-06-23-23:24
 */
@Controller
@RequestMapping("/manage")
public class ManageController {
    @Autowired
    private CustomerService customerService;
    @PostMapping(value = "/edit")
    public String add(@RequestBody Map<String,String> password){
        System.out.println("修改密码");
        String old_password = password.get("old_password");
        String new_password = password.get("new_password");
        String again_password = password.get("again_password");
        customerService.renewPassword(old_password,new_password,again_password);
        return "redirect:/index.html";
    }


}
